<?php
/**********************************************************
  eCode Marketing System
  Version 0.1
  Frontend Main Page (/index.php)
**********************************************************/

// Require configuration
define("FROMSCRIPT", true);
require_once(dirname(__FILE__)."/config.php");

if($db->get_results("SELECT * FROM `" . DB_TBL_PREFIX . "campaigns`") == false) {
$pagetitle = "No Offers Available";
$pageheading = "There Are No " . SITE_NAME . " Offers Currently Available";
$page_content = "<p>Watch for the next " . ORGANIZATION .
" advertisement in your local newspaper.</p>\n" .
"<p><a href=\"/help.php\">Help</a></p>\n";
} else {
$pagetitle = "Home";
$pageheading = "Welcome to the " . SITE_NAME ." Web Site!";
$page_content = "<p>Please enter the " . OFFER_CODE .
" printed on the bottom of your " . ORGANIZATION . " advertisement.</p>\n" .
"<form action=\"offers.php\" method=\"get\">\n" .
"<div id=\"offer-box\">\n" .
"<p><label for=\"offer_code\">" . OFFER_CODE . ":</label><br />\n" .
"<input type=\"text\" name=\"offer_code\" id=\"offer_code\" /><br />\n" .
"<input type=\"submit\" value=\"Go\" /></p>\n" .
"<p><a href=\"/help.php\">" . SITE_NAME . " Help</a></p>\n" .
"</div>\n" .
"</form>";
}
// Get XHTML footer
require_once(TEMPLATE_DIR . "/index.php");
?>